<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<style>
    .show-hover {
        width: 200px;
        height: 200px;
        background: rebeccapurple;
        border: 1px solid gray;
        border-radius: 5px;
        margin: auto;
    }
    .show-hover::before {
        content: '';
        position: absolute;
        width: 200px;
        height: 200px;
        background: green;
        display: none;
        opacity: .4;
    }
    .show-hover:hover::before {
        display: inline-block;
    }
</style>

<body>
    <div class="show-hover">hover效果</div>
</body>
</html>